package Function.monsterattack;

import FCRendering.FCRBattleOrderConstant;
import FCRendering.FCRConstants;
import FCRendering.FCRMaster;
import Frame.battleanimation.ABattleAni;
import Function.FCMutilPlayCache;
import Function.FCMutilPlayPropulsionCache;
import Function.FCMutilPlayTankCache;
import Function.ItemUse.FCItemUseCenter;
import Function.monsterattack.msSkills.*;
import VWorldGameStudio.*;

import java.util.ArrayList;
import java.util.HashMap;

import static FCRendering.FCRMaster.*;

public class FCMonsterAttackCenter {
    private static FCMonsterAttackCenter center;

    static {
        center = new FCMonsterAttackCenter();
    }

    private HashMap<String, AMonsterFakeAI> monsterAis = new HashMap<>();
    private HashMap<String, ASpecialAttack> monsterSpecialAttacks = new HashMap<>();

    public static FCMonsterAttackCenter getIn() {
        return center;
    }

    //TODO 维护者要参考这里填充怪物打法
    public FCMonsterAttackCenter() {
        monsterSpecialAttacks.put("xiXue", new XIXueMsAttack());//吸血
        monsterSpecialAttacks.put("callPartner", new PartnerHelpMsAttck());//呼叫同伴
        monsterSpecialAttacks.put("MsChongZhuang", new MsCollideMsAttack());//撞击
        monsterSpecialAttacks.put("MsBoomItSelf", new MsZiBaoMsAttack());//自爆
        monsterSpecialAttacks.put("MsNoMoving", new NoMovingMsAttack());//静止不动，做思考等
        monsterSpecialAttacks.put("MsUpDownJump", new UpDownJumpMsAttack());//上下跳动

        monsterAis.put("dog", new Dog());
    }

    public ABattleAni getBattleABattleAniByMsAttck(FCMonster monster, MstAttack mstAttack, int[] startPoint,int[] targetPoint) {
        ASpecialAttack specialAttack = monsterSpecialAttacks.get(mstAttack.getAnimationId());
        if (specialAttack != null) {
            return specialAttack.getBattleAnimation(monster, mstAttack, startPoint, targetPoint);
        }
        return null;
    }

    public FCBattleOrder getBattleOrderByMonster(FCMonster monster, int monsterNum) {
        AMonsterFakeAI ai = monsterAis.get(monster.getName());
        if (ai != null) {
            return ai.createMonsterOrder(monster, monsterNum);
        }
        return null;
    }


    public ArrayList<FCPlayerBattleWrap> getAttackPlayerByGun(MstAttack mstAttack, FCMonster srcMs, FCBattleOrder order, FCPlayerBattleWrap target) {
        ArrayList<FCPlayerBattleWrap> ret = new ArrayList<>(0);
        if (mstAttack.getElementHurt() > 0 || mstAttack.getHurtToTank() > 0 || mstAttack.getHurtToMan() > 0
                || mstAttack.getDesdenfese() > 0 || mstAttack.getDestruction() > 0) {
            int msHiteRate = srcMs.getHitRate();
            FCPlayerInfo p = FCMutilPlayCache.findPlayerByName(target.getHostUid(), target.getName());
            if (p == null) {
                return ret;
            }
            int targetDogerate = p.getDogeRate();
            if (target.isBattleDriverTank()) {
                FCTank tank = FCMutilPlayTankCache.findTankByName(p.getPlayertankHostId(), p.getPlayertank1());
                if (tank != null) {
                    targetDogerate = tank.getDogeRate(p.getSpeed2());
                }
            }
            if (order.randomV2 * 100 <= (msHiteRate - targetDogerate)) {
                //怪物命中了
                ret.add(target);
                if (mstAttack.getTargetNum() > 1) {
                    for (int i = 0; i < fcv.getBattleWraps().size(); i++) {
                        FCPlayerBattleWrap t = fcv.getBattleWraps().get(i);
                        FCPlayerInfo pm = FCMutilPlayCache.findPlayerByName(t.getHostUid(), t.getName());
                        if (pm != null && t != target && !pm.isDeath()) {
                            ret.add(t);
                        }
                        if (ret.size() == mstAttack.getTargetNum()) {
                            break;//够人了
                        }
                    }
                }
            }
        }
        return ret;
    }

    //单体攻击，投掷的
    public ArrayList<FCPlayerBattleWrap> getAttackPlayerByThrow(String itemName, FCMonster srcMs, FCBattleOrder order, FCPlayerBattleWrap target) {
        ArrayList<FCPlayerBattleWrap> ret = new ArrayList<>(0);
        int msHiteRate = srcMs.getHitRate();
        FCPlayerInfo p = FCMutilPlayCache.findPlayerByName(target.getHostUid(), target.getName());
        if (p == null) {
            return ret;
        }
        int targetDogerate = p.getDogeRate();
        if (target.isBattleDriverTank()) {
            FCTank tank = FCMutilPlayTankCache.findTankByName(p.getPlayertankHostId(), p.getPlayertank1());
            if (tank != null) {
                targetDogerate = tank.getDogeRate(p.getSpeed2());
            }
        }
        if (order.randomV2 * 100 <= (msHiteRate - targetDogerate)) {
            //怪物命中了
            ret.add(target);
        }
        return ret;
    }

    public void attackToPlayerByGun(MstAttack mstAttack, FCMonster srcMs, FCBattleOrder order, FCPlayerBattleWrap target) {
        //TODO 人物要是睡眠中受到攻击会醒来,移除掉睡眠状态
        target.removeLongTermState(FCRBattleOrderConstant.S_Sleep);
        ASpecialAttack specialAttack = monsterSpecialAttacks.get(mstAttack.getName());
        attackToPlayerByGunInternal(mstAttack, srcMs, order, target);

        if (specialAttack != null) {
            specialAttack.specialMsAttack(mstAttack, srcMs, order, target);
        }
    }

    public void attackToPlayerByGunInternal(MstAttack mstAttack, FCMonster srcMs, FCBattleOrder order, FCPlayerBattleWrap target) {
        ArrayList<FCPlayerBattleWrap> allWraps = getAttackPlayerByGun(mstAttack, srcMs, order, target);
        if (allWraps.size() > 0) {
            StringBuilder allInfo = new StringBuilder();
            for (FCPlayerBattleWrap wrap : allWraps) {
                FCPlayerInfo p = FCMutilPlayCache.findPlayerByName(wrap.getHostUid(), wrap.getName());
                if (p == null || p.isDeath()) {
                    continue;
                }
                if(allInfo.toString().length() > 1){
                    allInfo.append(",");
                }
                allInfo.append(p.getChName());
                //   System.out.println("attackToPlayerByGunInternal " + allWraps.size());
                FCTank fcTank = tankLib.getTankOfID(p.getPlayertank1(), p.getPlayertankHostId());
                if (fcTank != null && wrap.isBattleDriverTank()) {
                    int oldTankDefense = fcTank.getDefense();
                    //STEP 1 先将战车破甲
                    if (mstAttack.getDesdenfese() > 0 && fcTank.getDefense() > 0) {
                        int newD = fcTank.getDefense() - mstAttack.getDesdenfese();
                        newD = Math.max(0, newD);
                        fcTank.setDefense(newD);
                    }
                    //STEP 2 将战车破坏,规则是找到对方最低防御的
                    if (mstAttack.getDestruction() > 0) {
                        FCItem item = fcTank.findTheMaxLowDefenseItem();
                        if (item != null) {
                            int newD = item.getCurrentDefense() - mstAttack.getDestruction();
                            newD = Math.max(0, newD);
                            item.setCurrentDefense(newD);
                            if (item.getCurrentDefense() == 0) {
                                System.out.println(langLib.getNameOfId(fcTank.getName()) + "的" + item.getChName() + " 被破坏了");
                                allInfo.append(item.getChName() + " 被破坏了");
                            }else {
                                allInfo.append(item.getChName() + " 被击中");
                            }
                        }
                    }

                    boolean hasAttackTank = false;//是否攻击过坦克了
                    //STEP 3 减战车防甲
                    if (mstAttack.getHurtToTank() > 0) {
                        if (fcTank.getDefense() > 0) {
                            int newD = fcTank.getDefense() - mstAttack.getHurtToTank();
                            newD = Math.max(0, newD);
                            fcTank.setDefense(newD);

                            hasAttackTank = true;
                        } else {
                            FCItem item = fcTank.findTheMaxLowDefenseItem();
                            if (item != null) {
                                int newD = item.getCurrentDefense() - mstAttack.getHurtToTank();
                                newD = Math.max(0, newD);
                                item.setCurrentDefense(newD);
                                if (item.getCurrentDefense() == 0) {
                                    System.out.println(langLib.getNameOfId(fcTank.getName()) + "的" + item.getChName() + " 被破坏了");
                                    allInfo.append(item.getChName() + " 被破坏了");
                                }else {
                                    allInfo.append(item.getChName() + " 被击中");
                                }
                                hasAttackTank = true;
                            }
                        }
                    }

                    int dd = oldTankDefense - fcTank.getDefense();

                    if (dd > 0) {
                        System.out.println(langLib.getNameOfId(fcTank.getName()) + " 减" + dd + "SP");
                        allInfo.append(" SP减"+dd);
                    }
                    //STEP 4 如果战车没甲了，
                    if (fcTank.getDefense() == 0 && !hasAttackTank && mstAttack.getHurtToMan() > 0) {
                        int playerDefense = p.getPlayerWuliDefend();
                        System.out.println(p.getChName() + " 物理防御=" + playerDefense);
                        int sudBlood = mstAttack.getHurtToMan() - playerDefense;
                        sudBlood = Math.max(1, sudBlood);
                        wrap.setShowAttckHurt(sudBlood);
                        p.subBlood(sudBlood);
                        System.out.println(p.getChName() + " 减" + sudBlood + "血量");
                        allInfo.append(" HP减"+sudBlood);
                    }
                    //     System.out.println("dd " + dd+" "+fcTank.getDefense()+" ");
                    //STEP 5 属性有的情况下，直接命中属性伤害,还没死的情况下
                    if (!p.isDeath() && !mstAttack.getElement().equals("null")) {
                        //主要是依靠随机率来判断中不中了，
                        checkElement(allInfo, wrap, p, order, fcTank, mstAttack.getElement(), mstAttack.getElementHurt(), mstAttack.getRounds());
                    }

                    if (p.getAliasUID().equals(gameSave.HOST_UID) && fcTank.isTankAllBroken()) {
                        //TODO 必须是本地的玩家角色判断，坦克全损了
                        wrap.setBattleDriverTank(false);
                        wrap.checkAndSyncBattleWrap();
                        if (!fcTank.getType().equals("owner")) {
                            //TODO ,车内物品会自动放到保管处， 出租车直接回收
                            gameSave.useTankOfPlayerId(p, p.getPlayertank1(), p.getPlayertankHostId());
                            gameSave.delTankItemClone(fcTank.getChassisID());
                            gameSave.delTankItemClone(fcTank.getEngineID());
                            gameSave.delTankItemClone(fcTank.getRadarID());
                            gameSave.delTankItemClone(fcTank.getGunID());
                            gameSave.delTankItemClone(fcTank.getGun2ID());
                            gameSave.delTankItemClone(fcTank.getCdeviceID());
                            gameSave.delTankItemClone(fcTank.getSEID());
                            for (int t = 0; t < 10; t++) {
                                FCItem item = itemLib.getItemOfID(fcTank.getKnapsack()[t]);
                                if (item != null) {
                                    //放到保管处
                                    gameSave.getFcBankList().add(fcTank.getKnapsack()[t]);
                                }
                            }
                            gameSave.getTankSaveIos().remove(fcTank.getID());
                            fcTank.setVisable(0);
                            fcv.getLocalPropulsions().remove(fcTank);
                            FCMutilPlayPropulsionCache.loacalNoShareIt(fcTank);
                            gameSave.getFcZucheTankList().remove(fcTank.getName());
                            fcv.getMessage().add("出租车背包物品将自动放入保管处!");
                            fcv.showMessage();
                            System.out.println("出租车因破损被强制回收了");
                            allInfo.append(" 出租车因破损被强制回收了");
                        }
                    }
                } else {
                    if (mstAttack.getHurtToMan() > 0) {
                        //STEP 4，进行对人伤害
                        FCItem pant = itemLib.getItemOfID(p.getPants());
                        int hurt = mstAttack.getHurtToMan();
                        if (pant != null && pant.getCurrentDefense() > 0) {
                            if (hurt >= pant.getCurrentDefense()) {
                                hurt = hurt - pant.getCurrentDefense();
                                pant.setCurrentDefense(0);
                                System.out.println(p.getChName() + " 防弹衣破烂了");
                                allInfo.append(" 防弹衣破损了");
                            }
                        }
                        int playerDefense = p.getPlayerWuliDefend();
                        System.out.println(p.getChName() + " 物理防御=" + playerDefense);
                        int sudBlood = hurt - playerDefense;
                        sudBlood = Math.max(1, sudBlood);
                        wrap.setShowAttckHurt(sudBlood);
                        p.subBlood(sudBlood);
                        System.out.println(p.getChName() + " 减" + sudBlood + "血量");
                        allInfo.append(" HP减"+sudBlood);
                    }
                    //STEP 5 属性有的情况下，直接命中属性伤害
                    if (!p.isDeath() && !mstAttack.getElement().equals("null")) {
                        //主要是依靠随机率来判断中不中了，
                        checkElement(allInfo, wrap, p, order, null, mstAttack.getElement(), mstAttack.getElementHurt(), mstAttack.getRounds());
                    }
                }
                if(p.isDeath()){
                    allInfo.append(" 死亡了");
                }
            }
            fcv.endBattleInfo(allInfo.toString());
            fcv.getMessage().add(allInfo.toString());
            fcv.showMessage();
        } else {
            if (mstAttack.getElementHurt() > 0 || mstAttack.getHurtToTank() > 0 || mstAttack.getHurtToMan() > 0
                    || mstAttack.getDesdenfese() > 0 || mstAttack.getDestruction() > 0) {
                fcv.getMessage().add((fcv.getBattleMonster().indexOf(srcMs) + 1) + "号"+srcMs.getChName()+" 攻击未命中");
                fcv.showMessage();
                System.out.println((fcv.getBattleMonster().indexOf(srcMs) + 1) + "号"+srcMs.getChName()+" 攻击未命中");
            } else {
                //TODO 辅助技能不是向人物输出的
            }
        }
    }


    public void attackToPlayerByThrow(String itemName, FCMonster srcMs, FCBattleOrder order, FCPlayerBattleWrap target) {
        //TODO 人物要是睡眠中受到攻击会醒来,移除掉睡眠状态,
        target.removeLongTermState(FCRBattleOrderConstant.S_Sleep);
        ArrayList<FCPlayerBattleWrap> allWraps = getAttackPlayerByThrow(itemName, srcMs, order, target);
        FCItem useItem = itemLib.getItemOfID(itemName);
        if (allWraps.size() > 0) {
            StringBuilder allInfo = new StringBuilder();
            for (FCPlayerBattleWrap wrap : allWraps) {
                FCPlayerInfo p = FCMutilPlayCache.findPlayerByName(wrap.getHostUid(), wrap.getName());
                if (p == null || p.isDeath()) {
                    continue;
                }
                if(allInfo.toString().length() > 1){
                    allInfo.append(",");
                }
                allInfo.append(p.getChName());

                FCTank fcTank = tankLib.getTankOfID(p.getPlayertank1(), p.getPlayertankHostId());
                if (fcTank != null && wrap.isBattleDriverTank()) {
                    //STEP 1 属性伤害
                    if (!useItem.getElements().equals("null")) {
                        checkElement(allInfo, wrap, p, order, fcTank, useItem.getElements(), useItem.getElementsValue(), useItem.getElementsRound());
                    }
                    //STEP 2 普通攻击
                    if (useItem.getAttackHurt() > 0) {
                        if (fcTank.getDefense() > 0) {
                            int newD = fcTank.getDefense() - useItem.getAttackHurt();
                            newD = Math.max(0, newD);
                            fcTank.setDefense(newD);
                        }
                    }
                } else {
                    //STEP 1 属性伤害
                    if (!useItem.getElements().equals("null")) {
                        checkElement(allInfo, wrap, p, order, null, useItem.getElements(), useItem.getElementsValue(), useItem.getElementsRound());
                    }
                    //STEP 2 普通攻击
                    if (useItem.getAttackHurt() > 0) {
                        FCItem pant = itemLib.getItemOfID(p.getPants());
                        int hurt = useItem.getAttackHurt();
                        if (pant != null && pant.getCurrentDefense() > 0) {
                            if (hurt >= pant.getCurrentDefense()) {
                                hurt = hurt - pant.getCurrentDefense();
                                pant.setCurrentDefense(0);
                                System.out.println(p.getChName() + " 防弹衣破烂了");
                                allInfo.append("防弹衣破损了");
                            }
                        }
                        int playerDefense = p.getPlayerWuliDefend();
                        System.out.println(p.getChName() + " 物理防御=" + playerDefense);
                        int sudBlood = hurt - playerDefense;
                        sudBlood = Math.max(1, sudBlood);
                        wrap.setShowAttckHurt(sudBlood);
                        p.subBlood(sudBlood);
                        System.out.println(p.getChName() + " 减" + sudBlood + "血量");

                        allInfo.append(" HP减"+sudBlood);
                    }
                }

                //STEP 3 buff增减
                if (useItem.getHitRate() != 0) {
                    wrap.addlongTermState(FCRBattleOrderConstant.S_AddHitRate, useItem.getHitRate(), useItem.getAttackRound());
                    System.out.println(p.getChName() + " 命中降低");
                    allInfo.append(" 命中降低了");
                }
                if (useItem.getSpeedAdd() != 0) {
                    wrap.addlongTermState(FCRBattleOrderConstant.S_AddSpeed, useItem.getSpeedAdd(), useItem.getAttackRound());
                    System.out.println(p.getChName() + " 速度降低");

                    allInfo.append(" 速度降低了");
                }
                if (useItem.getCrit() != 0) {
                    wrap.addlongTermState(FCRBattleOrderConstant.S_AddCrit, (int) (useItem.getCrit() * 100), useItem.getAttackRound());
                    System.out.println(p.getChName() + " 暴击降低");

                    allInfo.append(" 暴击降低了");
                }

                if(p.isDeath()){
                    allInfo.append(" 死亡了");
                }
            }

            fcv.getMessage().add(allInfo.toString());
            fcv.showMessage();
            fcv.endBattleInfo(allInfo.toString());
        } else {
            fcv.getMessage().add((fcv.getBattleMonster().indexOf(srcMs) + 1) + "号"+srcMs.getChName()+" 攻击未命中");
            fcv.showMessage();
            System.out.println((fcv.getBattleMonster().indexOf(srcMs) + 1) + "号"+srcMs.getChName()+" 攻击未命中");
        }
    }

    private void checkElement(StringBuilder stringBuilder, FCPlayerBattleWrap wrap, FCPlayerInfo p, FCBattleOrder order, FCTank fcTank, String elementName, int val, int round) {
        int elementDefenese = 0;
        int dogerate = p.getDogeRate();
        if (FCRBattleOrderConstant.S_Frozen.equals(elementName)) {
            elementDefenese = p.getPlayerFrozenDefend();
            if ((int) (order.randomV3 * 100) > (dogerate / 2 + elementDefenese)) {
                //中了,立马造成伤害，并且感染
               // p.subBlood(val);
                wrap.addlongTermState(FCRBattleOrderConstant.S_Frozen, val, round);
                System.out.println(p.getChName() + " 感染了冷冻并受到" + val + "点伤害");
                stringBuilder.append(" 受寒了");
            }
            System.out.println(p.getChName() + " 冰抗=" + elementDefenese);
        } else if (FCRBattleOrderConstant.S_Gas.equals(elementName)) {
            elementDefenese = p.getPlayerGasDefend();
            if ((int) (order.randomV3 * 100) > (dogerate / 2 + elementDefenese)) {
                //中了,立马造成伤害，并且感染
                //p.subBlood(val);
                wrap.addlongTermState(FCRBattleOrderConstant.S_Gas, val, round);
                System.out.println(p.getChName() + " 感染了毒气并受到" + val + "点伤害");
                stringBuilder.append(" 中毒了");
            }
            System.out.println(p.getChName() + " 毒抗=" + elementDefenese);
        } else if (FCRBattleOrderConstant.S_Paralysis.equals(elementName)) {
            elementDefenese = p.getPlayerParalysisDefend();
            if ((int) (order.randomV3 * 100) > (dogerate / 2 + elementDefenese)) {
                //中了,立马造成伤害，并且感染
                //p.subBlood(val);
                wrap.addlongTermState(FCRBattleOrderConstant.S_Paralysis, val, round);
                System.out.println(p.getChName() + " 感染了麻痹并受到" + val + "点伤害");
                stringBuilder.append(" 麻痹了");
            }
            System.out.println(p.getChName() + " 麻痹抗性=" + elementDefenese);
        } else if (FCRBattleOrderConstant.S_Sleep.equals(elementName)) {
            elementDefenese = p.getPlayerSleepDefend();
            if ((int) (order.randomV3 * 100) > (dogerate / 2 + elementDefenese)) {
                if (fcTank != null && (fcTank.isOpenKongTiao() || fcTank.isOpenQiShan())) {
                    //开空调的话，中睡眠的回合减一
                    if (round > 0) {
                        round -= 1;
                    }
                }
                wrap.addlongTermState(FCRBattleOrderConstant.S_Sleep, val, round);
                System.out.println(p.getChName() + " 进入了睡眠");

                stringBuilder.append(" 睡着了");
            }
            System.out.println(p.getChName() + " 睡眠抗性=" + elementDefenese);
        } else if (FCRBattleOrderConstant.S_Fire.equals(elementName)) {
            elementDefenese = p.getPlayerFireDefend();
            if ((int) (order.randomV3 * 100) > (dogerate / 2 + elementDefenese)) {
                wrap.addlongTermState(FCRBattleOrderConstant.S_Fire, val, round);
                System.out.println(p.getChName() + " 被燃烧并受到" + val + "点伤害");
                stringBuilder.append(" 着火了");
            }
            System.out.println(p.getChName() + " 火抗性=" + elementDefenese);
        } else if (FCRBattleOrderConstant.S_Acid.equals(elementName)) {
            if (fcTank != null && fcTank.getDefense() > 0) {//坐坦克，坦克有甲的时候坦克中酸，没则角色中
                int tankdogerate = fcTank.getDogeRate(p.getSpeed2());
                if ((int) (order.randomV3 * 100) > (60 + tankdogerate)) {
                    fcTank.setAcidState(true);//TODO 坦克中酸
                    System.out.println(langLib.getNameOfId(fcTank.getName()) + " 中酸了");
                    stringBuilder.append(" 中酸了");
                }
            } else {
                elementDefenese = p.getPlayerAcidDefend();
                if ((int) (order.randomV3 * 100) > (dogerate / 2 + elementDefenese)) {
                    wrap.addlongTermState(FCRBattleOrderConstant.S_Acid, val, round);
                    System.out.println(p.getChName() + " 中酸了并受到" + val + "点伤害");
                    stringBuilder.append(" 中酸了");
                }
                System.out.println(p.getChName() + " 酸性抗性=" + elementDefenese);
            }
        } else if (FCRBattleOrderConstant.S_Fog.equals(elementName)) {
            if ((int) (order.randomV3 * 100) < val) {
                //这个特别一点
                wrap.addlongTermState(FCRBattleOrderConstant.S_Fog, 1, round);
                System.out.println(p.getChName() + " 中了烟雾，命中将降低");
                stringBuilder.append(" 被烟雾笼罩了");
            }
        } else if (FCRBattleOrderConstant.S_Confusion.equals(elementName)) {
            if ((int) (order.randomV3 * 100) < val) {
                //这个特别一点
                wrap.addlongTermState(FCRBattleOrderConstant.S_Confusion, 1, round);
                System.out.println(p.getChName() + " 中了混乱");
                stringBuilder.append(" 混乱了");
            }
        } else if (FCRBattleOrderConstant.S_Cement.equals(elementName)) {
            if ((int) (order.randomV3 * 100) < val) {
                //这个特别一点
                wrap.addlongTermState(FCRBattleOrderConstant.S_Cement, 1, round);
                System.out.println(p.getChName() + " 中了水泥，回避减低");
                stringBuilder.append(" 陷入水泥了");
            }
        }
    }

    public void addBuffToMonsterByThrow(String itemName, FCMonster srcMs, FCBattleOrder order, FCMonster target) {
        FCItem useItem = itemLib.getItemOfID(itemName);
        if (useItem.getBloodAdd() > 0) {//TODO 加血了.立刻加血
            target.setBlood(target.getBlood() + useItem.getBloodAdd());
            fcv.getMessage().add(target.getChName() + "-" + (fcv.getBattleMonster().indexOf(target) + 1) + "号 增加了" + useItem.getBloodAdd() + "血量");
            fcv.showMessage();
            System.out.println(target.getChName() + "-" + (fcv.getBattleMonster().indexOf(target) + 1) + "号 增加了" + useItem.getBloodAdd() + "血量");
            fcv.endBattleInfo( (fcv.getBattleMonster().indexOf(target) + 1) + "号#"+target.getChName()+" HP加"+useItem.getBloodAdd());
        }
    }
}
